<template>
  <body id="login">
  <iframe src="../.."></iframe>
  <el-container id="login-container">
    <el-header>
      <h2 style="color: cornflowerblue ">欢迎来到论文管理系统</h2>
    </el-header>

    <el-container id="login-form">
      <div>
        <el-radio-group v-model="loginWay">
          <el-radio-button label="用户名密码登录"></el-radio-button>
          <el-radio-button label="QQ验证登录"></el-radio-button>
        </el-radio-group>
      </div>
    </el-container>
  </el-container>
  </body>
</template>

<script>
export default {
  name: 'Login',
  data () {
    return {
      loginWay:'用户名密码登录',
      loginForm: {
        username: '',
        password: '',
        code: ''
      }
    }
  },
  methods: {
    handleLogin () {
      var _this = this
      // console.log(this.$store.state)
      this.$axios.post('/login', {
        username: this.loginForm.username,
        password: this.loginForm.password
      }).then(successResponse => {
        if (successResponse.data.code === 200) {
          _this.$store.commit('login', _this.loginForm)
          var path = this.$route.query.redirect
          this.$router.replace({
            path: path === '/' || path === undefined ? '/index' : path
          })
        }
      }).catch(failResponse => {
        alert('Login Wrong')
      })
    }
  }
}
</script>

<style scoped>
/*页面整体设置*/
#login{
  background-position: center;
  height: 100%;
  width: 100%;
  background-size: cover;
  position: fixed;
}
/*消除边缘白色*/
html,body{
  margin:0;
  padding:0;
}
/*表单容器*/
#login-container{
  border-radius: 20px;
  margin: 200px auto;
  width:500px;
  border:2px solid lightblue;
  padding:20px;
  background: #ffffff;
}
/*标题*/
.el-header{
  margin-top: 10px;
  align-items: center;
  justify-items: center;

}
.login-form{
  border-radius: 20px;
  margin: 200px auto;
  width:350px;
  border:2px solid lightblue;
  padding:20px;
  background: #ffffff;
}
.el-container{
  align-items: center;
}
</style>
